<template>
  <editor-tabs
    :editor-init="editorInit"
    :tabs-remove="handleTabsRemove"
    :tabs-click="handleTabsClick"
    :state="$store.state.functions"
  />
</template>

<script>
import EditorTabs from '@/components/EditorTabs';
export default {
  components: {
    EditorTabs
  },
  methods: {
    editorInit() {
      require('brace/ext/language_tools');
      require('brace/mode/python');
      require('brace/theme/chrome');
      require('brace/mode/less');
      require('brace/snippets/python');
    },
    handleTabsRemove(targetName) {
      this.$store.commit('functions/setEditorFiles', {
        type: 'remove',
        data: {
          id: targetName
        }
      });
    },
    // 防止控制台报错
    handleTabsClick(target) {
      console.log(target);
    }
  }
};
</script>
